home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / additm / additem.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  2.5 KB  |  73 lines

  1. VERSION 2.00
  2. Begin Form frmAddItemTest 
  3.    Caption         =   "AddItem Test Form"
  4.    ClientHeight    =   5010
  5.    ClientLeft      =   870
  6.    ClientTop       =   1530
  7.    ClientWidth     =   4800
  8.    Height          =   5415
  9.    Left            =   810
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5010
  13.    ScaleWidth      =   4800
  14.    Top             =   1185
  15.    Width           =   4920
  16.    Begin CommandButton pbWithOutNULL 
  17.       Caption         =   "Insert Without NULL"
  18.       Height          =   492
  19.       Left            =   2400
  20.       TabIndex        =   2
  21.       Top             =   4320
  22.       Width           =   1812
  23.    End
  24.    Begin CommandButton pbWithNULL 
  25.       Caption         =   "Insert With NULL"
  26.       Height          =   492
  27.       Left            =   360
  28.       TabIndex        =   1
  29.       Top             =   4320
  30.       Width           =   1692
  31.    End
  32.    Begin ListBox lstBox 
  33.       Height          =   2760
  34.       Left            =   480
  35.       TabIndex        =   0
  36.       Top             =   1200
  37.       Width           =   3975
  38.    End
  39.    Begin Label Label1 
  40.       Caption         =   "frmAddItem.Load calls GetPrivateProfileString (which is exported in KERNEL.EXE) and retrieves a NULL terminated string from WIN.INI.  The pushbuttons invoke AddItem with a string expression; they concat a string literal, replacing or ignoring the NULLs"
  41.       FontBold        =   -1  'True
  42.       FontItalic      =   0   'False
  43.       FontName        =   "MS Serif"
  44.       FontSize        =   6.75
  45.       FontStrikethru  =   0   'False
  46.       FontUnderline   =   0   'False
  47.       ForeColor       =   &H00000000&
  48.       Height          =   972
  49.       Left            =   120
  50.       TabIndex        =   3
  51.       Top             =   120
  52.       Width           =   4572
  53.    End
  54. ' Form Level Variable Declarations
  55. Dim strReturned As String * 30
  56. Sub Form_Load ()
  57.     iReturn% = GetProfileString("Extensions", "wri", "Nothing Returned", strReturned, Len(strReturned))
  58. End Sub
  59. Sub pbWithNULL_Click ()
  60.     ' Local Variable Declarations
  61.         Dim strItem As String * 30
  62.     strItem = strReturned
  63.     lstBox.AddItem strItem + " *** With NULL ***"
  64. End Sub
  65. Sub pbWithOutNULL_Click ()
  66.     ' Local Variable Declarations
  67.         Dim strItem As String * 30
  68.     strItem = strReturned
  69.     iPosition% = InStr(1, strItem, Chr$(0))
  70.     Mid$(strItem, iPosition%) = Space$((Len(strItem) - iPosition%) + 1)
  71.     lstBox.AddItem strItem + " *** Without NULL ***"
  72. End Sub
  73.